package cn.kwq.project_manger.pojo.dto;

import cn.kwq.project_manger.pojo.Msg;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "发送消息体")
public class SendMsg {

    @ApiModelProperty("发送消息的人，示例：系统发送/xxx队长发送")
    private String fromStr;

    @ApiModelProperty("发送消息给的人，示例：xxx队员，xxx项目发布者")
    private String toStr;

    @ApiModelProperty("发送给哪个人（id）")
    private Long toId;

    //类型Team组队信息 Project项目信息 Game比赛信息
    @ApiModelProperty("类型Team组队信息 Project项目信息 Game比赛信息")
    private String type;

    @ApiModelProperty("消息体内容")
    private String msg;


    public Msg getMsg(){
     return    Msg
             .builder()
             .fromStr(this.fromStr)
             .toStr(this.toStr)
             .toId(this.toId)
             .type(this.type)
             .msg(this.msg)
             .isRead(0)
             .build();
    }



}
